<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 6.编写一个函数，计算三个数字的大小，按从小到大顺序输出
        function numCount() {
            let res
            for (let i = 0; i < arguments.length - 1; i++) {
                for (let j = i; j < arguments.length - 1; j++) {
                    if (arguments[j] > arguments[j + 1]) {
                        res = arguments[j]
                        arguments[j] = arguments[j + 1]
                        arguments[j + 1] = res
                    }
                }
            }


            let arr = []


            for (let i = 0; i < arguments.length; i++) {
                arr[i] = arguments[i]
            }

            return arr
        }

        console.log(numCount(1, 2, 3, 4, 89, 6, 5));
    </script>
</body>

</html>